package com.fen.common;

import org.springframework.stereotype.Controller;
/**
* @Description: 统一返回类
* @Author: lijiafen
* @Date:
* @Time:
* @eamil: 2368044269@qq.com
*/
@Controller
public class Result<T> {
    private Integer code;
    private String msg;
    private T date;

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public Result(Integer code, String msg, T date) {
        this.code = code;
        this.msg = msg;
        this.date = date;
    }

    public Result() {
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getDate() {
        return date;
    }

    public Result setDate(T date) {
        this.date = date;
        return this;
    }
    public static Result getSuccess() {
        return new Result(200,"成功");
    }
    public static Result getFailure() {
        return new Result(500,"失败");
    }
}
